package com.panda.command;

import java.util.Map;

abstract class Argument {


    private Argument next;

    Argument next(Argument a) {
        next = a;
        return a;
    }

    abstract boolean canHandle(String a);

    abstract void doHandle(Map<String, String> as, String a);


    void handle(Map<String, String> as, String s) {

       if (canHandle(s)) {

           doHandle(as, s);

       } else {

           if (next != null) {
               next.handle(as, s);
           }

       }

   }


}
